package 统一响应封装;

import java.io.Serializable;
import java.util.Collections;
import java.util.List;
public class 统一响应封装
{
    public static void main(String[] args){
        Result error=Result.error(404,"not found");
        System.out.println(error.getData()+"_"+error.getCode()+"_"+error.getMsg());
        Result success=Result.success(new Info("hwm",23));
        System.out.println(success.getData());
    }
}
class Info{
    String name;
    int age;
    Info(String name,int age){
        this.age=age;
        this.name=name;
    }
    @Override
    public String toString(){
        return "{name:"+name+",age:"+age+"}";
    }

}




